timezone_offset_get
Alias for DateTimeZone::getOffset - Returns the time difference relative to GMT
timezone_offset_get()
returns the timezone offset relative to GMT.
Returns the time zone offset relative to GMT:
<?php $tz = timezone_open ( "Asia/Taipei" ) ; $dateTimeNY = date_create ( "now" , timezone_open ( "America/New_York" ) ) ; echo timezone_offset_get ( $tz , $dateTimeNY ) ; ?>
Try it yourself
timezone_offset_get ( object , datetime ) ;
parameter | describe |
---|---|
object | Required. Specifies the DateTimeZone object returned by timezone_open() . |
datetime | Required. Specifies the date/time to which the offset needs to be calculated. |